package net.suncaper.demo.controller;

import net.suncaper.demo.domain.Product;
import net.suncaper.demo.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class RestProductController {
    @Autowired
    private ProductService productService;
   // @RequestMapping(method = RequestMethod.GET,value = "/api/user")
    @GetMapping("/api/product")
    public List<Product> listAllProducts(){
        return productService.findProduct(null);
    }
}
